<template>
    <div class="signView">
        {{ value }}<span style="margin-left:20px;font-size:12px;color:blue;cursor: pointer;"  @click="openSign">查看签名</span><span style="margin-left:5px;font-size:12px;color:blue;cursor: pointer;"   @click="openSignAll">查看材料</span>
    
    
        <el-dialog
        title="图片查看"
        append-to-body
        :visible.sync="dialogVisible"
        width="600px">
        <el-image :src="src">
      
        </el-image>
        <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
        </span>
        </el-dialog>

        <el-dialog
        title="图片查看"
        append-to-body
        :visible.sync="dialogVisible2"
        width="600px">
        <div style="height:750px;overflow: auto;">
            <el-image :src="src2">
      
            </el-image>
        </div>
        
        <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="dialogVisible2 = false">确 定</el-button>
        </span>
        </el-dialog>
    </div>
</template>
<script>
export default {
    props:["id","exkey","data","index","dataField"],
    data(){       
        return{
            pId:"",
            cId:"",
            value:"",
            dialogVisible:false,
            dialogVisible2:false,
            
            src:"",
            src2:""
        }
    },
    created(){
        console.log("created=====================")
       
        if(this.index||this.index=="0"){
            this.value=this.data[this.dataField][this.index][this.id]
        }else{
            let ids=this.id.split(".");
            this.pId=ids[0];
            this.cId=ids[1];
            
            this.value=this.data[this.pId][this.cId]
        }
        let signField=this.exkey.signField;
        let signAllField=this.exkey.signAllField;
        this.src=this.data[this.dataField][this.index][signField].split(",")[this.data[this.dataField][this.index][signField].split(",").length-1]
        this.src2=this.data[this.dataField][this.index][signAllField].split(",")[this.data[this.dataField][this.index][signAllField].split(",").length-1]
        console.log("id========signView===="+this.id)

        //alert(this.src+"=="+this.src2+"=="+this.data[this.dataField][this.index][signField])
        console.log(this.data[this.dataField][this.index][signField].split(","),"ss====")
    },
    methods:{
        openSign(){
            this.dialogVisible=true;
        },
        openSignAll(){
            this.dialogVisible2=true;
        }
    }
}
</script>